package cn.iocoder.yudao.module.eval.controller.admin.plan.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.*;
import java.time.LocalDate;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;

@Schema(description = "管理后台 - 评价计划新增/修改 Request VO")
@Data
public class EvalPlanSaveReqVO {

    @Schema(description = "主键ID", example = "1024")
    private Long id;

    @Schema(description = "计划名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024年数控车工技能等级认定")
    @NotEmpty(message = "计划名称不能为空")
    @Size(max = 200, message = "计划名称长度不能超过200个字符")
    private String planName;

    @Schema(description = "计划编码", example = "PLAN-2024-001")
    @Size(max = 50, message = "计划编码长度不能超过50个字符")
    private String planCode;

    @Schema(description = "批次名称", example = "第一批")
    @Size(max = 100, message = "批次名称长度不能超过100个字符")
    private String batchName;

    @Schema(description = "职业ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "职业ID不能为空")
    private Long professionId;

    @Schema(description = "职业名称", example = "数控车工")
    @Size(max = 100, message = "职业名称长度不能超过100个字符")
    private String professionName;

    @Schema(description = "职业代码", example = "6-31-01-03")
    @Size(max = 50, message = "职业代码长度不能超过50个字符")
    private String professionCode;

    @Schema(description = "适用等级", example = "五级,四级,三级")
    @Size(max = 200, message = "适用等级长度不能超过200个字符")
    private String applicableLevels;

    @Schema(description = "考评员姓名", example = "张三,李四,王五")
    @Size(max = 255, message = "考评员姓名长度不能超过255个字符")
    private String kpyrName;

    @Schema(description = "评价方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "assessment")
    @NotEmpty(message = "评价方式不能为空")
    @Pattern(regexp = "^(assessment|competency|combined|competition)$", message = "评价方式必须是assessment、competency、combined、competition之一")
    private String evaluationMethod;

    @Schema(description = "评价模板ID", example = "1")
    private Long templateId;

    @Schema(description = "报名开始日期", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-01-01")
    @NotNull(message = "报名开始日期不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate registrationStartDate;

    @Schema(description = "报名结束日期", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-01-15")
    @NotNull(message = "报名结束日期不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate registrationEndDate;

    @Schema(description = "评价开始日期", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-02-01")
    @NotNull(message = "评价开始日期不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate evaluationStartDate;

    @Schema(description = "评价结束日期", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-02-15")
    @NotNull(message = "评价结束日期不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate evaluationEndDate;

    @Schema(description = "计划状态", example = "0")
    private Integer planStatus;

    @Schema(description = "目标受众", example = "all")
    @Pattern(regexp = "^(all|department|position|manual)$", message = "目标受众必须是all、department、position、manual之一")
    private String targetAudience;

    @Schema(description = "目标部门ID列表", example = "1,2,3")
    private String targetDepartments;

    @Schema(description = "目标岗位ID列表", example = "1,2,3")
    private String targetPositions;

    @Schema(description = "每个计划最大人数", example = "100")
    @Min(value = 1, message = "每个计划最大人数必须大于0")
    private Integer maxPeoplePerPlan;

    @Schema(description = "联系人", example = "张三")
    @Size(max = 50, message = "联系人长度不能超过50个字符")
    private String contactPerson;

    @Schema(description = "联系电话", example = "13800138000")
    @Size(max = 20, message = "联系电话长度不能超过20个字符")
    private String contactPhone;

    @Schema(description = "联系邮箱", example = "zhangsan@example.com")
    @Email(message = "联系邮箱格式不正确")
    @Size(max = 100, message = "联系邮箱长度不能超过100个字符")
    private String contactEmail;

    @Schema(description = "计划描述", example = "本次评价计划针对数控车工技能等级认定")
    @Size(max = 1000, message = "计划描述长度不能超过1000个字符")
    private String planDescription;

}
